package com.zzh.study.dao;

import com.zzh.study.model.po.WebFluxDemoPO;
import org.reactivestreams.Publisher;
import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.relational.core.sql.In;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * @PackageName:com.zzh.study.config
 * @ClassName:ProductRepository
 * @Description:
 * @author:zhangzhanheng
 * @date: 2020/12/18 17:09
 */
@Repository
@Component
public interface WebFluxDemoPORepository extends ReactiveCrudRepository<WebFluxDemoPO,Integer> {

    @Query("SELECT * FROM web_flux_demo WHERE realname = :realname LIMIT :page,:pageSize")
    Flux<WebFluxDemoPO> findByRealName(String realname, Integer page,Integer pageSize);

    @Query("select id,username,password,realname,email,phone,deleteStatus from web_flux_demo")
    Flux<WebFluxDemoPO> findByPage();
}
